<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>若依RuoYi-Vue代码学习一---通用分页处理 | Program W</title><meta name="keywords" content="ry,前后端分离"><meta name="author" content="Program W"><meta name="copyright" content="Program W"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="@[toc] 一、先运行看看接口到sql 随便找个表格看看 &#x3D;&#x3D;可以看到传入了，分页关键属性&#x3D;&#x3D; 看看debug的日志打印的sql   [debug,137] - &#x3D;&#x3D;&gt;  Preparing: select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type LIM">
<meta property="og:type" content="article">
<meta property="og:title" content="若依RuoYi-Vue代码学习一---通用分页处理">
<meta property="og:url" content="https://lwstudy.gitee.io/2021/11/23/ry-vue-demo2/index.html">
<meta property="og:site_name" content="Program W">
<meta property="og:description" content="@[toc] 一、先运行看看接口到sql 随便找个表格看看 &#x3D;&#x3D;可以看到传入了，分页关键属性&#x3D;&#x3D; 看看debug的日志打印的sql   [debug,137] - &#x3D;&#x3D;&gt;  Preparing: select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type LIM">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://s2.loli.net/2021/12/10/muYWxT7gpvj1LqB.jpg">
<meta property="article:published_time" content="2021-11-23T09:23:30.000Z">
<meta property="article:modified_time" content="2021-12-13T03:22:56.923Z">
<meta property="article:author" content="Program W">
<meta property="article:tag" content="ry">
<meta property="article:tag" content="前后端分离">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://s2.loli.net/2021/12/10/muYWxT7gpvj1LqB.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://lwstudy.gitee.io/2021/11/23/ry-vue-demo2/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: Program W","link":"链接: ","source":"来源: Program W","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '若依RuoYi-Vue代码学习一---通用分页处理',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-12-13 11:22:56'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/spider.jpeg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">10</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首頁</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 其他</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li><li><a class="site-page child" href="/resources/"><i class="fa-fw fa-heartbeat"></i><span> 资源</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> One Piece</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://s2.loli.net/2021/12/10/muYWxT7gpvj1LqB.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Program W</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首頁</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 其他</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li><li><a class="site-page child" href="/resources/"><i class="fa-fw fa-heartbeat"></i><span> 资源</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> One Piece</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">若依RuoYi-Vue代码学习一---通用分页处理</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-11-23T09:23:30.000Z" title="发表于 2021-11-23 17:23:30">2021-11-23</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-12-13T03:22:56.923Z" title="更新于 2021-12-13 11:22:56">2021-12-13</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/ry/">ry</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/ry/%E5%89%8D%E5%90%8E%E7%AB%AF%E5%88%86%E7%A6%BB/">前后端分离</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="若依RuoYi-Vue代码学习一---通用分页处理"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p>@[toc]</p>
<h1 id="一、先运行看看接口到sql"><a href="#一、先运行看看接口到sql" class="headerlink" title="一、先运行看看接口到sql"></a>一、先运行看看接口到sql</h1><ul>
<li>随便找个表格看看<br><img src="https://img-blog.csdnimg.cn/b89b93433f5d4f358918a7f3688ab7fa.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAUHJvZ3JhbSBX,size_20,color_FFFFFF,t_70,g_se,x_16" alt="在这里插入图片描述"></li>
<li>==可以看到传入了，分页关键属性==<br><img src="https://img-blog.csdnimg.cn/3abe24b098a449b9b5ee365e79e06137.png" alt="在这里插入图片描述"></li>
<li>看看<code>debug</code>的日志打印的<code>sql</code><blockquote>
<ul>
<li> [debug,137] - ==&gt;  Preparing: select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type LIMIT ?</li>
<li>[debug,137] - ==&gt; Parameters: 10(Integer)</li>
<li>[debug,137] - &lt;==      Total: 10</li>
</ul>
<p>可以看出并没有<code>分页语句</code></p>
</blockquote>
</li>
</ul>
<h1 id="二、来看看若依怎么处理的分页"><a href="#二、来看看若依怎么处理的分页" class="headerlink" title="二、来看看若依怎么处理的分页"></a>二、来看看若依怎么处理的分页</h1><ul>
<li>于是，我找到接口位置</li>
</ul>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="meta">@PreAuthorize(&quot;@ss.hasPermi(&#x27;system:dict:list&#x27;)&quot;)</span></span><br><span class="line">    <span class="meta">@GetMapping(&quot;/list&quot;)</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> TableDataInfo <span class="title">list</span><span class="params">(SysDictType dictType)</span></span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        <span class="comment">//表格通用===分页处理</span></span><br><span class="line">        startPage();</span><br><span class="line">        List&lt;SysDictType&gt; list = dictTypeService.selectDictTypeList(dictType);</span><br><span class="line">        <span class="comment">//响应请求分页数据</span></span><br><span class="line">        <span class="keyword">return</span> getDataTable(list);</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<ul>
<li>可以看到，在查sql的前后都有一个处理方法<br>先看看<code>startPage();</code></li>
</ul>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 设置请求分页数据</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">protected</span> <span class="keyword">void</span> <span class="title">startPage</span><span class="params">()</span></span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        <span class="comment">//构建分页实体</span></span><br><span class="line">        PageDomain pageDomain = TableSupport.buildPageRequest();</span><br><span class="line">        Integer pageNum = pageDomain.getPageNum();</span><br><span class="line">        Integer pageSize = pageDomain.getPageSize();</span><br><span class="line"></span><br><span class="line">        <span class="comment">//分页关键属性 判空</span></span><br><span class="line">        <span class="keyword">if</span> (StringUtils.isNotNull(pageNum) &amp;&amp; StringUtils.isNotNull(pageSize))</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="comment">//按 Sql 转义顺序</span></span><br><span class="line">            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());</span><br><span class="line">            <span class="comment">//分页参数合理化</span></span><br><span class="line">            Boolean reasonable = pageDomain.getReasonable();</span><br><span class="line">            <span class="comment">//分页工具使用</span></span><br><span class="line">            PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<ul>
<li>看这里就要进去看最主要的构建了：<code>TableSupport.buildPageRequest();</code></li>
</ul>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 封装分页对象</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> PageDomain <span class="title">getPageDomain</span><span class="params">()</span></span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        <span class="comment">//分页数据实体</span></span><br><span class="line">        PageDomain pageDomain = <span class="keyword">new</span> PageDomain();</span><br><span class="line">        <span class="comment">/**</span></span><br><span class="line"><span class="comment">         * ServletUtils客户端工具类</span></span><br><span class="line"><span class="comment">         * getParameterToInt(PAGE_NUM)</span></span><br><span class="line"><span class="comment">         * ====&gt;具体操作：</span></span><br><span class="line"><span class="comment">         * 获取get方法中的参数 getRequest().getParameter(name)</span></span><br><span class="line"><span class="comment">         * 类型转换器转IntConvert.toInt()</span></span><br><span class="line"><span class="comment">         */</span></span><br><span class="line">        pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM));</span><br><span class="line">        pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE));</span><br><span class="line">        pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));</span><br><span class="line">        pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));</span><br><span class="line">        pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));</span><br><span class="line">        <span class="keyword">return</span> pageDomain;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">	<span class="comment">//指向上面的方法</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> PageDomain <span class="title">buildPageRequest</span><span class="params">()</span></span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> getPageDomain();</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<p>==这是请求参数的枚举==<br><img src="https://img-blog.csdnimg.cn/4a50bdabdb334946bda8dc8ed3eefae1.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAUHJvZ3JhbSBX,size_20,color_FFFFFF,t_70,g_se,x_16" alt="在这里插入图片描述"></p>
<blockquote>
<p>到这里，知道了怎么获取到请求的<br><code>pageNum: 1 pageSize: 10</code>了</p>
</blockquote>
<h1 id="三、最后回到接口，及其参数返回"><a href="#三、最后回到接口，及其参数返回" class="headerlink" title="三、最后回到接口，及其参数返回"></a>三、最后回到接口，及其参数返回</h1><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="meta">@PreAuthorize(&quot;@ss.hasPermi(&#x27;system:dict:list&#x27;)&quot;)</span></span><br><span class="line">    <span class="meta">@GetMapping(&quot;/list&quot;)</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> TableDataInfo <span class="title">list</span><span class="params">(SysDictType dictType)</span></span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        <span class="comment">//表格通用===分页处理</span></span><br><span class="line">        startPage();</span><br><span class="line">        List&lt;SysDictType&gt; list = dictTypeService.selectDictTypeList(dictType);</span><br><span class="line">        <span class="comment">//响应请求分页数据</span></span><br><span class="line">        <span class="keyword">return</span> getDataTable(list);</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<ul>
<li>来看看<code>getDataTable(list);</code></li>
</ul>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 响应请求分页数据</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="meta">@SuppressWarnings(&#123; &quot;rawtypes&quot;, &quot;unchecked&quot; &#125;)</span></span><br><span class="line">    <span class="function"><span class="keyword">protected</span> TableDataInfo <span class="title">getDataTable</span><span class="params">(List&lt;?&gt; list)</span></span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        <span class="comment">//设置分页同意返回</span></span><br><span class="line">        TableDataInfo rspData = <span class="keyword">new</span> TableDataInfo();</span><br><span class="line">        rspData.setCode(HttpStatus.SUCCESS);</span><br><span class="line">        rspData.setMsg(<span class="string">&quot;查询成功&quot;</span>);</span><br><span class="line">        rspData.setRows(list);</span><br><span class="line">        rspData.setTotal(<span class="keyword">new</span> PageInfo(list).getTotal());</span><br><span class="line">        <span class="keyword">return</span> rspData;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
<ul>
<li>就可以看到，可复用的，==分页专用==的返回响应数据<br><code>w(ﾟДﾟ)w！</code>就到这里了</li>
</ul>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Program W</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://lwstudy.gitee.io/2021/11/23/ry-vue-demo2/">https://lwstudy.gitee.io/2021/11/23/ry-vue-demo2/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://lwstudy.gitee.io" target="_blank">Program W</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/ry/">ry</a><a class="post-meta__tags" href="/tags/%E5%89%8D%E5%90%8E%E7%AB%AF%E5%88%86%E7%A6%BB/">前后端分离</a></div><div class="post_share"><div class="social-share" data-image="https://s2.loli.net/2021/12/10/muYWxT7gpvj1LqB.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2021/11/24/ry-vue-demo3/"><img class="prev-cover" src="https://s2.loli.net/2021/12/10/7jpGreZhuBQ9kLa.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">若依RuoYi-Vue代码学习一---登录实现（验证码校验、token生成，token过滤【验证】）</div></div></a></div><div class="next-post pull-right"><a href="/2021/11/23/ry-vue-demo1/"><img class="next-cover" src="https://s2.loli.net/2021/12/10/ux2afMVbTPFZdqz.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">若依RuoYi-Vue代码学习一---注解与切面</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2021/11/23/ry-vue-demo1/" title="若依RuoYi-Vue代码学习一---注解与切面"><img class="cover" src="https://s2.loli.net/2021/12/10/ux2afMVbTPFZdqz.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-11-23</div><div class="title">若依RuoYi-Vue代码学习一---注解与切面</div></div></a></div><div><a href="/2021/11/24/ry-vue-demo3/" title="若依RuoYi-Vue代码学习一---登录实现（验证码校验、token生成，token过滤【验证】）"><img class="cover" src="https://s2.loli.net/2021/12/10/7jpGreZhuBQ9kLa.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-11-24</div><div class="title">若依RuoYi-Vue代码学习一---登录实现（验证码校验、token生成，token过滤【验证】）</div></div></a></div><div><a href="/2021/11/25/ry-vue-demo4/" title="若依RuoYi-Vue代码学习一---【DEBUG】登录验证时，Spring Security怎么帮我们查的用户信息"><img class="cover" src="/img/default.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-11-25</div><div class="title">若依RuoYi-Vue代码学习一---【DEBUG】登录验证时，Spring Security怎么帮我们查的用户信息</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/spider.jpeg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Program W</div><div class="author-info__description">这是一次开始</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">10</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/lwstudy"><i class="fab fa-github"></i><span>Gitee</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitee.com/lwstudy" target="_blank" title="Gitee"><i class="fab fa-guilded"></i></a><a class="social-icon" href="https://blog.csdn.net/weixin_46037781" target="_blank" title="CSDN"><i class="fas fa-copyright"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">我们总得留下些什么吧</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E5%85%88%E8%BF%90%E8%A1%8C%E7%9C%8B%E7%9C%8B%E6%8E%A5%E5%8F%A3%E5%88%B0sql"><span class="toc-number">1.</span> <span class="toc-text">一、先运行看看接口到sql</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E6%9D%A5%E7%9C%8B%E7%9C%8B%E8%8B%A5%E4%BE%9D%E6%80%8E%E4%B9%88%E5%A4%84%E7%90%86%E7%9A%84%E5%88%86%E9%A1%B5"><span class="toc-number">2.</span> <span class="toc-text">二、来看看若依怎么处理的分页</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E6%9C%80%E5%90%8E%E5%9B%9E%E5%88%B0%E6%8E%A5%E5%8F%A3%EF%BC%8C%E5%8F%8A%E5%85%B6%E5%8F%82%E6%95%B0%E8%BF%94%E5%9B%9E"><span class="toc-number">3.</span> <span class="toc-text">三、最后回到接口，及其参数返回</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/05/06/learn-drools/" title="规则引擎Drools学习与实例"><img src="https://s2.loli.net/2022/05/06/wNBo1Zb9L3npHC8.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="规则引擎Drools学习与实例"/></a><div class="content"><a class="title" href="/2022/05/06/learn-drools/" title="规则引擎Drools学习与实例">规则引擎Drools学习与实例</a><time datetime="2022-05-06T08:45:21.000Z" title="发表于 2022-05-06 16:45:21">2022-05-06</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/05/06/my-down/" title="Java爬虫多线程下载实例"><img src="https://s2.loli.net/2022/05/06/eXjyW9FbK2LwxVG.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java爬虫多线程下载实例"/></a><div class="content"><a class="title" href="/2022/05/06/my-down/" title="Java爬虫多线程下载实例">Java爬虫多线程下载实例</a><time datetime="2022-05-06T08:33:11.000Z" title="发表于 2022-05-06 16:33:11">2022-05-06</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/11/25/ry-vue-demo4/" title="若依RuoYi-Vue代码学习一---【DEBUG】登录验证时，Spring Security怎么帮我们查的用户信息"><img src="/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="若依RuoYi-Vue代码学习一---【DEBUG】登录验证时，Spring Security怎么帮我们查的用户信息"/></a><div class="content"><a class="title" href="/2021/11/25/ry-vue-demo4/" title="若依RuoYi-Vue代码学习一---【DEBUG】登录验证时，Spring Security怎么帮我们查的用户信息">若依RuoYi-Vue代码学习一---【DEBUG】登录验证时，Spring Security怎么帮我们查的用户信息</a><time datetime="2021-11-25T01:10:30.000Z" title="发表于 2021-11-25 09:10:30">2021-11-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/11/24/ry-vue-demo3/" title="若依RuoYi-Vue代码学习一---登录实现（验证码校验、token生成，token过滤【验证】）"><img src="https://s2.loli.net/2021/12/10/7jpGreZhuBQ9kLa.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="若依RuoYi-Vue代码学习一---登录实现（验证码校验、token生成，token过滤【验证】）"/></a><div class="content"><a class="title" href="/2021/11/24/ry-vue-demo3/" title="若依RuoYi-Vue代码学习一---登录实现（验证码校验、token生成，token过滤【验证】）">若依RuoYi-Vue代码学习一---登录实现（验证码校验、token生成，token过滤【验证】）</a><time datetime="2021-11-24T09:10:30.000Z" title="发表于 2021-11-24 17:10:30">2021-11-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/11/23/ry-vue-demo2/" title="若依RuoYi-Vue代码学习一---通用分页处理"><img src="https://s2.loli.net/2021/12/10/muYWxT7gpvj1LqB.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="若依RuoYi-Vue代码学习一---通用分页处理"/></a><div class="content"><a class="title" href="/2021/11/23/ry-vue-demo2/" title="若依RuoYi-Vue代码学习一---通用分页处理">若依RuoYi-Vue代码学习一---通用分页处理</a><time datetime="2021-11-23T09:23:30.000Z" title="发表于 2021-11-23 17:23:30">2021-11-23</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://s2.loli.net/2021/12/10/muYWxT7gpvj1LqB.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2021 - 2022 By Program W</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">这里是底部了.请停止下降!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'zCYkwMBcHhcNvvPzdsooSPb1-gzGzoHsz',
      appKey: 'MxW3eBpKYaCGdvUxno6EkFuH',
      placeholder: '请留下你的足迹...',
      avatar: 'monsterid',
      meta: 'nick,mail,link'.split(','),
      pageSize: '10',
      lang: 'zh-CN',
      recordIP: false,
      serverURLs: '',
      emojiCDN: '',
      emojiMaps: "",
      enableQQ: false,
      path: window.location.pathname,
      requiredFields: ["nick,mail"],
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !true) {
  if (true) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>